package com.sixth.bean.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName BaseResultVo
 * @Description TODO
 * @Author XiaoWJ
 * @Date 2022/9/8 16:10
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseResultVo {


    /**
     * errno : 0
     * errmsg : 成功
     */

    private int errno;
    private String errmsg;

    public static BaseResultVo ok() {
        BaseResultVo baseResultVo = new BaseResultVo(0, "成功");
        return baseResultVo;
    }

    public static BaseResultVo ok(String msg) {
        BaseResultVo baseResultVo = new BaseResultVo(0, msg);
        return baseResultVo;
    }


    public static BaseResultVo error() {
        BaseResultVo baseResultVo = new BaseResultVo(605, "用户名或密码错误，请重新登录！");
        return baseResultVo;
    }

    public static BaseResultVo error(String msg) {
        BaseResultVo baseResultVo = new BaseResultVo(605, msg);
        return baseResultVo;
    }


}
